package com.bookstore.common.exception;

/**
 * 认证异常
 * 用于处理用户认证相关的异常情况
 */
public class AuthenticationException extends BusinessException {
    private static final long serialVersionUID = 1L;

    /**
     * 用户ID（可选，用于日志记录）
     */
    private Long userId;

    /**
     * 用户名（可选，用于日志记录）
     */
    private String username;

    public AuthenticationException(String message) {
        super(message);
    }

    public AuthenticationException(String errorCode, String message) {
        super(errorCode, message);
    }

    public AuthenticationException(String message, Long userId, String username) {
        super(message);
        this.userId = userId;
        this.username = username;
    }

    public AuthenticationException(String errorCode, String message, Long userId, String username) {
        super(errorCode, message);
        this.userId = userId;
        this.username = username;
    }

    public Long getUserId() {
        return userId;
    }

    public String getUsername() {
        return username;
    }
}